home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / cggsvd.z / cggsvd
Encoding:
Text File  |  2002-10-03  |  10.3 KB  |  331 lines

  1.  
  2.  
  3.  
  4. CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))                                                          CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CGGSVD - compute the generalized singular value decomposition (GSVD) of
  10.      an M-by-N complex matrix A and P-by-N complex matrix B
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE CGGSVD( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B, LDB,
  14.                         ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, RWORK,
  15.                         IWORK, INFO )
  16.  
  17.          CHARACTER      JOBQ, JOBU, JOBV
  18.  
  19.          INTEGER        INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P
  20.  
  21.          INTEGER        IWORK( * )
  22.  
  23.          REAL           ALPHA( * ), BETA( * ), RWORK( * )
  24.  
  25.          COMPLEX        A( LDA, * ), B( LDB, * ), Q( LDQ, * ), U( LDU, * ), V(
  26.                         LDV, * ), WORK( * )
  27.  
  28. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  29.      These routines are part of the SCSL Scientific Library and can be loaded
  30.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  31.      directs the linker to use the multi-processor version of the library.
  32.  
  33.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  34.      4 bytes (32 bits). Another version of SCSL is available in which integers
  35.      are 8 bytes (64 bits).  This version allows the user access to larger
  36.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  37.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  38.      only one of the two versions; 4-byte integer and 8-byte integer library
  39.      calls cannot be mixed.
  40.  
  41. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  42.      CGGSVD computes the generalized singular value decomposition (GSVD) of an
  43.      M-by-N complex matrix A and P-by-N complex matrix B:
  44.            U'*A*Q = D1*( 0 R ),    V'*B*Q = D2*( 0 R )
  45.  
  46.      where U, V and Q are unitary matrices, and Z' means the conjugate
  47.      transpose of Z.  Let K+L = the effective numerical rank of the matrix
  48.      (A',B')', then R is a (K+L)-by-(K+L) nonsingular upper triangular matrix,
  49.      D1 and D2 are M-by-(K+L) and P-by-(K+L) "diagonal" matrices and of the
  50.      following structures, respectively:
  51.  
  52.      If M-K-L >= 0,
  53.  
  54.                          K  L
  55.             D1 =     K ( I  0 )
  56.                      L ( 0  C )
  57.                  M-K-L ( 0  0 )
  58.  
  59.                        K  L
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))                                                          CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))
  71.  
  72.  
  73.  
  74.             D2 =   L ( 0  S )
  75.                  P-L ( 0  0 )
  76.  
  77.                      N-K-L  K    L
  78.        ( 0 R ) = K (  0   R11  R12 )
  79.                  L (  0    0   R22 )
  80.      where
  81.  
  82.        C = diag( ALPHA(K+1), ... , ALPHA(K+L) ),
  83.        S = diag( BETA(K+1),  ... , BETA(K+L) ),
  84.        C**2 + S**2 = I.
  85.  
  86.        R is stored in A(1:K+L,N-K-L+1:N) on exit.
  87.  
  88.      If M-K-L < 0,
  89.  
  90.                        K M-K K+L-M
  91.             D1 =   K ( I  0    0   )
  92.                  M-K ( 0  C    0   )
  93.  
  94.                          K M-K K+L-M
  95.             D2 =   M-K ( 0  S    0  )
  96.                  K+L-M ( 0  0    I  )
  97.                    P-L ( 0  0    0  )
  98.  
  99.                         N-K-L  K   M-K  K+L-M
  100.        ( 0 R ) =     K ( 0    R11  R12  R13  )
  101.                    M-K ( 0     0   R22  R23  )
  102.                  K+L-M ( 0     0    0   R33  )
  103.  
  104.      where
  105.  
  106.        C = diag( ALPHA(K+1), ... , ALPHA(M) ),
  107.        S = diag( BETA(K+1),  ... , BETA(M) ),
  108.        C**2 + S**2 = I.
  109.  
  110.        (R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N), and R33 is stored
  111.        ( 0  R22 R23 )
  112.        in B(M-K+1:L,N+M-K-L+1:N) on exit.
  113.  
  114.      The routine computes C, S, R, and optionally the unitary
  115.      transformation matrices U, V and Q.
  116.  
  117.      In particular, if B is an N-by-N nonsingular matrix, then the GSVD of A
  118.      and B implicitly gives the SVD of A*inv(B):
  119.                           A*inv(B) = U*(D1*inv(D2))*V'.
  120.      If ( A',B')' has orthnormal columns, then the GSVD of A and B is also
  121.      equal to the CS decomposition of A and B. Furthermore, the GSVD can be
  122.      used to derive the solution of the eigenvalue problem:
  123.                           A'*A x = lambda* B'*B x.
  124.      In some literature, the GSVD of A and B is presented in the form
  125.                       U'*A*X = ( 0 D1 ),   V'*B*X = ( 0 D2 )
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))                                                          CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      where U and V are orthogonal and X is nonsingular, and D1 and D2 are
  141.      ``diagonal''.  The former GSVD form can be converted to the latter form
  142.      by taking the nonsingular matrix X as
  143.  
  144.                            X = Q*(  I   0    )
  145.                                  (  0 inv(R) )
  146.  
  147.  
  148. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  149.      JOBU    (input) CHARACTER*1
  150.              = 'U':  Unitary matrix U is computed;
  151.              = 'N':  U is not computed.
  152.  
  153.      JOBV    (input) CHARACTER*1
  154.              = 'V':  Unitary matrix V is computed;
  155.              = 'N':  V is not computed.
  156.  
  157.      JOBQ    (input) CHARACTER*1
  158.              = 'Q':  Unitary matrix Q is computed;
  159.              = 'N':  Q is not computed.
  160.  
  161.      M       (input) INTEGER
  162.              The number of rows of the matrix A.  M >= 0.
  163.  
  164.      N       (input) INTEGER
  165.              The number of columns of the matrices A and B.  N >= 0.
  166.  
  167.      P       (input) INTEGER
  168.              The number of rows of the matrix B.  P >= 0.
  169.  
  170.      K       (output) INTEGER
  171.              L       (output) INTEGER On exit, K and L specify the dimension
  172.              of the subblocks described in Purpose.  K + L = effective
  173.              numerical rank of (A',B')'.
  174.  
  175.      A       (input/output) COMPLEX array, dimension (LDA,N)
  176.              On entry, the M-by-N matrix A.  On exit, A contains the
  177.              triangular matrix R, or part of R.  See Purpose for details.
  178.  
  179.      LDA     (input) INTEGER
  180.              The leading dimension of the array A. LDA >= max(1,M).
  181.  
  182.      B       (input/output) COMPLEX array, dimension (LDB,N)
  183.              On entry, the P-by-N matrix B.  On exit, B contains part of the
  184.              triangular matrix R if M-K-L < 0.  See Purpose for details.
  185.  
  186.      LDB     (input) INTEGER
  187.              The leading dimension of the array B. LDB >= max(1,P).
  188.  
  189.      ALPHA   (output) REAL array, dimension (N)
  190.              BETA    (output) REAL array, dimension (N) On exit, ALPHA and
  191.              BETA contain the generalized singular value pairs of A and B;
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))                                                          CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))
  203.  
  204.  
  205.  
  206.              ALPHA(1:K) = 1,
  207.              BETA(1:K)  = 0, and if M-K-L >= 0, ALPHA(K+1:K+L) = C,
  208.              BETA(K+1:K+L)  = S, or if M-K-L < 0, ALPHA(K+1:M)= C,
  209.              ALPHA(M+1:K+L)= 0
  210.              BETA(K+1:M) = S, BETA(M+1:K+L) = 1 and ALPHA(K+L+1:N) = 0
  211.              BETA(K+L+1:N)  = 0
  212.  
  213.      U       (output) COMPLEX array, dimension (LDU,M)
  214.              If JOBU = 'U', U contains the M-by-M unitary matrix U.  If JOBU =
  215.              'N', U is not referenced.
  216.  
  217.      LDU     (input) INTEGER
  218.              The leading dimension of the array U. LDU >= max(1,M) if JOBU =
  219.              'U'; LDU >= 1 otherwise.
  220.  
  221.      V       (output) COMPLEX array, dimension (LDV,P)
  222.              If JOBV = 'V', V contains the P-by-P unitary matrix V.  If JOBV =
  223.              'N', V is not referenced.
  224.  
  225.      LDV     (input) INTEGER
  226.              The leading dimension of the array V. LDV >= max(1,P) if JOBV =
  227.              'V'; LDV >= 1 otherwise.
  228.  
  229.      Q       (output) COMPLEX array, dimension (LDQ,N)
  230.              If JOBQ = 'Q', Q contains the N-by-N unitary matrix Q.  If JOBQ =
  231.              'N', Q is not referenced.
  232.  
  233.      LDQ     (input) INTEGER
  234.              The leading dimension of the array Q. LDQ >= max(1,N) if JOBQ =
  235.              'Q'; LDQ >= 1 otherwise.
  236.  
  237.      WORK    (workspace) COMPLEX array, dimension (max(3*N,M,P)+N)
  238.  
  239.      RWORK   (workspace) REAL array, dimension (2*N)
  240.  
  241.      IWORK   (workspace/output) INTEGER array, dimension (N)
  242.              On exit, IWORK stores the sorting information. More precisely,
  243.              the following loop will sort ALPHA for I = K+1, min(M,K+L) swap
  244.              ALPHA(I) and ALPHA(IWORK(I)) endfor such that ALPHA(1) >=
  245.              ALPHA(2) >= ... >= ALPHA(N).
  246.  
  247.      INFO    (output) INTEGER
  248.              = 0:  successful exit.
  249.              < 0:  if INFO = -i, the i-th argument had an illegal value.
  250.              > 0:  if INFO = 1, the Jacobi-type procedure failed to converge.
  251.              For further details, see subroutine CTGSJA.
  252.  
  253. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  254.      TOLA    REAL
  255.              TOLB    REAL TOLA and TOLB are the thresholds to determine the
  256.              effective rank of (A',B')'. Generally, they are set to TOLA =
  257.              MAX(M,N)*norm(A)*MACHEPS, TOLB = MAX(P,N)*norm(B)*MACHEPS.  The
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))                                                          CCCCGGGGGGGGSSSSVVVVDDDD((((3333SSSS))))
  269.  
  270.  
  271.  
  272.              size of TOLA and TOLB may affect the size of backward errors of
  273.              the decomposition.
  274.  
  275.              Further Details ===============
  276.  
  277.              2-96 Based on modifications by Ming Gu and Huan Ren, Computer
  278.              Science Division, University of California at Berkeley, USA
  279.  
  280. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  281.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  282.  
  283.      This man page is available only online.
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.